package cn.xiaye.blog.servlet;

import cn.xiaye.blog.bean.Context;
import cn.xiaye.blog.dao.MessageDao;
import cn.xiaye.blog.db.util.CommonUtil;

@SuppressWarnings("serial")
public class DeleteMessage extends FatherServlet {

	@Override
	public String excute(Context context) {
		if(!CommonUtil.isLogin(context.getSession())){
			return "login.jsp";
		}
		String id = context.getRequest().getParameter("message_id");
		MessageDao messageDao = new MessageDao();
		messageDao.deleteMessage(Integer.valueOf(id));
		return "ShowDeleteMessagePage";
	}
}
